package com.st.buy.util.pojo;

/**
 * @author 张双虎
 * 分装返回值结果
 */
public class BuyResult {
    private String msg; // 响应消息
    private int status; // 响应状态码
    private Object data; // 响应时携带的数据

    /**
     * 快速的生成一个状态码为200的BuyResult对象
     * @return
     */
    public static BuyResult ok(){
        BuyResult buyResult = new BuyResult();
        buyResult.setStatus(200);
        buyResult.setMsg("ok");
        return buyResult;
    }

    public static BuyResult err5x(){
        BuyResult buyResult = new BuyResult();
        buyResult.setStatus(500);
        return buyResult;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
